home *** CD-ROM | disk | FTP | other *** search
- /* Definitions for VT package */
- /* $Header: vt.h,v 1.6 88/06/20 22:39:50 guido Exp $ */
-
- /* WARNING: the cursor coordinate system is (row, col) here,
- like in the ANSI escape sequences.
- However, the origin is 0, and ranges are given in C style:
- first, last+1. */
-
- #ifndef tbool
- #define tbool char
- #endif
-
- #define VTNARGS 10
-
- /* Struct defining a VT window */
-
- typedef struct _vt {
- WINDOW *win; /* Window used for display */
- char **data; /* Character data array [row][col] */
- unsigned char **flags; /* Corresponding flags per character */
- short *llen; /* Line length array */
- short rows, cols; /* Size of data matrix */
- short cwidth, cheight; /* Character cell size */
- short cur_row, cur_col; /* Cursor position */
- short save_row, save_col; /* Saved cursor position */
- short scr_top, scr_bot; /* Scrolling region */
- short topterm; /* Top line of emulated terminal */
- short toscroll; /* Delayed screen scrolling */
- unsigned char gflags; /* Global flags for inserted characters */
- tbool insert:1; /* Insert mode */
- tbool keypadmode:1; /* Send ESC O A for arrows, not ESC [ A */
- tbool nlcr:1; /* \n implies \r */
- tbool lazy:1; /* Delay output operations */
-
- /* State for the ANSI escape sequence interpreter */
-
- tbool modarg:1; /* Parsing ESC '[' '?' ... */
- char *(*action)(); /* Function to call for next input */
- short *nextarg; /* Points to current arg */
- short args[VTNARGS]; /* Argument list */
-
- /* ANSI flags and modes */
-
- /* There ought to be an array of tab stops here... */
-
- } VT;
-
- /* Flags in gflags and flags array.
- These correspond to the ANSI codes used in ESC [ ... m.
- Not all are implemented! */
-
- #define VT_BOLD (1 << 1)
- #define VT_DIM (1 << 2)
- #define VT_UNDERLINE (1 << 4)
- #define VT_BLINK (1 << 5)
- #define VT_INVERSE (1 << 7)
-
- /* Access macros */
-
- #define vtcheight(vt) ((vt)->cheight)
- #define vtcwidth(vt) ((vt)->cwidth)
- #define vtwindow(vt) ((vt)->win)
-
- #define vtsetnlcr(vt, new_nlcr) ((vt)->nlcr= (new_nlcr))
- #define vtsetlazy(vt, new_lazy) ((vt)->lazy= (new_lazy))
- #define vtsetflags(vt, new_flags) ((vt)->gflags= (new_flags))
- #define vtsetinsert(vt, new_insert) ((vt)->insert= (new_insert))
-
- /* Basic functions */
-
- VT *vtopen ARGS((char *title, int rows, int cols, int save));
- void vtclose ARGS((VT *vt));
- void vtputstring ARGS((VT *vt, char *text, int len));
- void vtsetcursor ARGS((VT *vt, int row, int col));
- void vtreset ARGS((VT *vt));
- VT *vtfind ARGS((WINDOW *win));
-
- /* Optional functions */
-
- void vtansiputs ARGS((VT *vt, char *text, int len));
- void vtputs ARGS((VT *vt, char *text));
- bool vtresize ARGS((VT *vt, int rows, int cols, int save));
- bool vtautosize ARGS((VT *vt));
-
- /* Functions used by the ANSI interface */
-
- void vtresetattr ARGS((VT *vt));
- void vtsetattr ARGS((VT *vt, int bit));
- void vtsavecursor ARGS((VT *vt));
- void vtrestorecursor ARGS((VT *vt));
- void vtarrow ARGS((VT *vt, int code, int repeat));
- void vteolclear ARGS((VT *vt, int row, int col));
- void vteosclear ARGS((VT *vt, int row, int col));
- void vtlinefeed ARGS((VT *vt, int repeat));
- void vtrevlinefeed ARGS((VT *vt, int repeat));
- void vtinslines ARGS((VT *vt, int n));
- void vtdellines ARGS((VT *vt, int n));
- void vtscrollup ARGS((VT *vt, int r1, int r2, int n));
- void vtscrolldown ARGS((VT *vt, int r1, int r2, int n));
- void vtinschars ARGS((VT *vt, int n));
- void vtdelchars ARGS((VT *vt, int n));
- void vtsetscroll ARGS((VT *vt, int top, int bot));
- void vtsendid ARGS((VT *vt));
- void vtsendpos ARGS((VT *vt));
-